<h1>Text</h1>

<p>Text is used to display a line of text. It contains an array of Characters 
which identify the glyphs that will be displayed along with style information 
that sets the colour of the text, the size of the font and the relative placement 
of the line within a block of text.</p>

<table>

<tr>
<th nowrap>Field Name</th>
<th>Type</th>
<th>Size</th>
<th>Description</th>
</tr>

<tr>
<td nowrap valign="top">type</td>
<td nowrap valign="top">unsigned bit</td>
<td nowrap valign="top" align="right">1</td>
<td>The type of text record.</td>
</tr>

<tr>
<td nowrap valign="top">reserved</td>
<td nowrap valign="top">unsigned bit</td>
<td nowrap valign="top" align="right">3</td>
<td>The type of text record.</td>
</tr>

<tr>
<td nowrap valign="top">hasFont</td>
<td nowrap valign="top">boolean</td>
<td nowrap valign="top" align="right">1</td>
<td>Is the identifier of the font used to display the text defined.</td>
</tr>

<tr>
<td nowrap valign="top">hasColor</td>
<td nowrap valign="top">boolean</td>
<td nowrap valign="top" align="right">1</td>
<td>Is the colour of the text defined.</td>
</tr>

<tr>
<td nowrap valign="top">hasBaseline</td>
<td nowrap valign="top">boolean</td>
<td nowrap valign="top" align="right">1</td>
<td>Is the baseline (y offset) of the text defined.</td>
</tr>

<tr>
<td nowrap valign="top">hasIndent</td>
<td nowrap valign="top">boolean</td>
<td nowrap valign="top" align="right">1</td>
<td>Is the indent (x offset) of the text defined.</td>
</tr>

<tr>
<td nowrap valign="top">identifier</td>
<td nowrap valign="top">unsigned int</td>
<td nowrap valign="top" align="right">16</td>
<td>The identifier, in the range 1..65535, of the font object which contains the 
glyphs representing each character displayed. Optional. Set to 0 if the font is 
not being changed.</td>
</tr>

<tr>
<td nowrap valign="top">color</td>
<td nowrap valign="top"></td>
<td nowrap valign="top" align="right">&nbsp;</td>
<td>A Color describing colour of the text. Optional. Set to null if the 
colour is not being changed.</td>
</tr>

<tr>
<td nowrap valign="top">indent</td>
<td nowrap valign="top">signed int</td>
<td nowrap valign="top" align="right">16</td>
<td>The offset, in twips, relative to the left side bounding rectangle of the text 
block where the text will be displayed. Optional. Set to zero if no indent is being 
specified.</td>
</tr>

<tr>
<td nowrap valign="top">baseline</td>
<td nowrap valign="top">signed int</td>
<td nowrap valign="top" align="right">16</td>
<td>The offset, in twips, relative to the bottom of the bounding rectangle of the 
text block where the text will be displayed. Optional. Set to the height of the 
font if only a single line of text is being displayed so the characters are placed 
correctly within the bounding rectangle defined for the text object.</td>
</tr>

<tr>
<td nowrap valign="top">height</td>
<td nowrap valign="top">unsigned int</td>
<td nowrap valign="top" align="right">16</td>
<td>The height of the font, in twips,  used to render the characters. Optional. 
Set to zero if the font size is not being changed.</td>
</tr>

<tr>
<td nowrap valign="top">characterCount</td>
<td nowrap valign="top">unsigned int</td>
<td nowrap valign="top" align="right">16</td>
<td>The number of characters in the line of text.</td>
</tr>

<tr>
<td nowrap valign="top">characters</td>
<td nowrap valign="top">Character</td>
<td nowrap valign="top" align="right">[characterCount]</td>
<td>An array of Characters which identify the glyph that will be displayed 
along with the spacing to the next character in the line of text.</td>
</tr>

</table>

<p>Whether the alpha channel in the colour needs to be specified depends on the 
class the Text is added to. DefineText2 supports transparent text 
while DefineText does not.</p>

<p>The x and y offsets are used to control how several lines of text are laid 
out to create a block. The y offset is specified relative to the bottom 
edge of the bounding rectangle, which is actually closer to the top of the screen 
as the direction of the y-axis is from the top to the bottom of the screen. In this 
respect Flash is counter-intuitive. Lines with higher offset values are displayed 
below lines with lower offsets.</p>

<p>When several lines are used to define a block of text using DefineText 
or DefineText2 the attributes such as the font selected, size and colour 
must be specified in the first line. For the remaining lines 
these may be set to null or zero. The attributes will apply to all following lines
 until explicitly changed.</p>

<h2>History</h2>

<p>Text represents both the TextRecordType0 and TextRecordType1 
structures from the Macromedia Flash (SWF) File Format Specification. It was 
introduced in Flash 1.</p> 
